import request from "@/utils/request.js";


/**
 * 商户管理分页列表
 * @param {Object} data 
 * @returns 
 */
export const merchantManagementList = (data) => {
    return request({
        url:'jy-system/api/enterprise/selectPage',
        method:'post',
        data
    })
}


/**
 * 新增商户
 * @param {Object} data 
 * @returns 
 */
export const newMerchant = (data) => {
    return request({
        url:'jy-system/api/enterprise/addNew',
        method:'post',
        data
    })
}


/**
 * 编辑商户
 * @param {Object} data 
 * @returns 
 */
export const editorialMerchant = (data) => {
    return request({
        url:'jy-system/api/enterprise/edit',
        method:'post',
        data
    })
}

/**
 * 获取企业信息
 * @param {Object} params 
 * @returns 
 */
export const getCorporateInformation = (params) => {
    return request({
        url:'jy-system/api/enterprise/get',
        method:'get',
        params
    })
}


/**
 * 门店列表下拉查询
 * @param {Object} data 
 * @returns 
 */
export const StoreManagementList = (data) => {
    return request({
        url:"/jy-system/api/store/selectPage",
        method:"post",
        data
    })
}

/**
 * 门店列表查询
 * @param {Object} data 
 * @returns 
 */
export const StoreManagementListTable = (data) => {
    return request({
        url:"/jy-system/api/store/cur/selectPage ",
        method:"post",
        data
    })
}




/**
 * 新增门店
 * @param {Object} data 
 * @returns 
 */
export const addStore = (data) => {
    return request({
        url:'/jy-system/api/store/addNew',
        method:'post',
        data
    })
}


/**
 * 编辑门店
 * @param {Object} data 
 * @returns 
 */
export const editorialStore = (data) => {
    return request({
        url:'/jy-system/api/store/edit',
        method:'post',
        data,
        noCancelToken:true
    })
}


/**
 * 获取门店信息
 * @param {Object} params 
 * @returns 
 */
export const getStoreInformation = (params) => {
    return request({
        url:'/jy-system/api/store/get',
        method:'get',
        params
    })
}



/**
 * 获取分组id
 * @param {Object} data 
 * @returns 
 */ 
export const getGroupId = (data) => {
    return request({
        url:'/jy-system/api/permission/area/rela/selectSingleStoreGroup',
        method:'post',
        data
    })
}


/**
 * 重置密码
 * @param {Object} params 
 * @returns 
 */
export const resetUserPassword = (params) => {
    return request({
        url:'/jy-system/api/enterprise/resetPwd',
        method:'get',
        params
    })
}


/**
 * 企业ID获取门店默认品牌类型
 * @param {Object} params 
 * @returns 
 */
export const getBrandType = (params) => {
    return request({
        url:`/jy-system/sysDataPermission/brandType/enterprise/${params.enterpriseId}`,
        method:'get',
        params
    })
}